-- Copyright (c) Huoty, All rights reserved
-- Author: Huoty <sudohuoty@gmail.com>
-- CreateTime: 2019-05-22 22:59:44

local foo = function ()
    print("hello world")
end


foo()

local function foo2() return 1, 2, 3 end

a, b = foo2()
print(a, b)

a, b, c = foo2()
print(a, b, c)

a, b, c, d = foo2()
print(a, b, c, d)

a, _, c = foo2()
print(a, c)


local function foo3(...)
    arg = {...}
    print("arg len:", #arg)
    for i, v in ipairs(arg) do
        print(i, v)
    end
end

foo3('a', 'b', 'c')
foo3(1, 2)


local function foo4(kwarg)
    print(kwarg.a, kwarg.b)
end

foo4{a=1, b=2}
